<?php
class Modulo extends MODEL{
	function Modulo(){
		$this->keyField = 'id_modulo';
		$this->addField('nom_modulo','Nome');
	}
	
	public function fetching(){
		$this->id_modulo = $this->getRowValue('id_modulo');
		$this->nom_modulo = $this->getRowValue('nom_modulo');
	}
	
	public function getAllModulos(){
		$modulos = array();
		
		$sql = 'select id_modulo, nom_modulo from modulo order by nom_modulo';
		$this->query($sql);
		
		while($this->fetch()){
			$modulos[$this->id_modulo] = $this->nom_modulo; 
		}
		
		return $modulos;
	}
}